package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 用户优惠券表
 * </p>
 *
 * @author whale
 * @since 2025-05-09
 */
@TableName("tb_user_coupon")
public class UserCoupon extends Model<UserCoupon> {

    private static final long serialVersionUID = 1L;

    /**
     * 用户优惠券唯一标识
     */
    @TableId("user_coupon_id")
    private Long userCouponId;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;
    /**
     * 模块id
     */
    @TableField("template_id")
    private Long templateId;
    /**
     * 优惠券编码
     */
    @TableField("coupon_code")
    private String couponCode;
    /**
     * 状态（0-未使用，1-已使用，2-已过期）
     */
    private Integer status;
    /**
     * 获取方式（1-主动领取，2-系统发放）
     */
    @TableField("obtain_type")
    private Integer obtainType;
    /**
     * 领取时间
     */
    @TableField("obtain_time")
    private Date obtainTime;
    /**
     * 有效期开始时间
     */
    @TableField("start_time")
    private Date startTime;
    /**
     * 有效期结束时间
     */
    @TableField("end_time")
    private Date endTime;
    /**
     * 使用订单id
     */
    @TableField("order_id")
    private Long orderId;
    /**
     * 使用时间
     */
    @TableField("use_time")
    private Date useTime;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public UserCoupon() {
        this.userCouponId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getUserCouponId() {
        return userCouponId;
    }

    public void setUserCouponId(Long userCouponId) {
        this.userCouponId = userCouponId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }

    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getObtainType() {
        return obtainType;
    }

    public void setObtainType(Integer obtainType) {
        this.obtainType = obtainType;
    }

    public Date getObtainTime() {
        return obtainTime;
    }

    public void setObtainTime(Date obtainTime) {
        this.obtainTime = obtainTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public Date getUseTime() {
        return useTime;
    }

    public void setUseTime(Date useTime) {
        this.useTime = useTime;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }


    @Override
    public String toString() {
        return "UserCoupon{" +
        ", userCouponId=" + userCouponId +
        ", userId=" + userId +
        ", templateId=" + templateId +
        ", couponCode=" + couponCode +
        ", status=" + status +
        ", obtainType=" + obtainType +
        ", obtainTime=" + obtainTime +
        ", startTime=" + startTime +
        ", endTime=" + endTime +
        ", orderId=" + orderId +
        ", useTime=" + useTime +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
